//
//  StockImageTime.m
//  Stock
//
//  Created by blacksun on 11-7-3.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "StockImageTime.h"


@implementation StockImageTime
@synthesize stockId;
@synthesize longTime;
@synthesize imageType;

+(StockImageTime *)findByStockId:(NSString *)stockId andImageType:(NSString *)imageType{
    NSString *criteria = [NSString stringWithFormat:@"where stock_id='%@' and image_type='%@'",stockId,imageType];
    StockImageTime *time = (StockImageTime*)[StockImageTime findFirstByCriteria:criteria];
    if (!time) {
        time = [[[StockImageTime alloc] init] autorelease];
        time.stockId = stockId;
        time.imageType = imageType;
    }
    return time;
    
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    NSLog(@"key:%@ not found",key);
}
-(void)dealloc{
    [stockId release];
    [longTime release];
    [imageType release];
    [super dealloc];
}
@end
